<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Dashboard">
    <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">

    <title>项目事务管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="__PUBLIC__/css/bootstrap.css" rel="stylesheet">
    <!--    external css-->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/zabuto_calendar.css">
    <link href="__PUBLIC__/font-awesome/css/font-awesome.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/gritter/css/jquery.gritter.css"/>
    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/css/style.css" rel="stylesheet">
    <link href="__PUBLIC__/css/index.css" rel="stylesheet">
    <link href="__PUBLIC__/css/date/date.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style-responsive.css" rel="stylesheet">

    <script src="__PUBLIC__/js/chart-master/Chart.js"></script>


    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<section id="container">
<!-- **********************************************************************************************************************************************************
TOP BAR CONTENT & NOTIFICATIONS
*********************************************************************************************************************************************************** -->
<!--header start-->
<header class="header black-bg">
    <div class="sidebar-toggle-box">
        <div class="fa fa-bars tooltips" data-plarcement="right" data-original-title="收缩侧边栏">
            <i class="fa "></i>
        </div>
    </div>
    <!--logo start-->
    <a href="../index.html" class="logo"><b>项目事务管理系统</b></a>
    <!--logo end-->

    <div class="top-menu">
        <ul class="nav pull-right top-menu">
            <li><a class="logout">退出系统</a></li>
        </ul>
    </div>

</header>
<!--header end-->


<!-- **********************************************************************************************************************************************************
MAIN SIDEBAR MENU
*********************************************************************************************************************************************************** -->
<!--sidebar start-->
<aside>
    <div id="sidebar" class="nav-collapse ">
        <!-- sidebar menu start-->
        <ul class="sidebar-menu" id="nav-accordion">

            <p class="centered"><a href="profile.html"><img src="__PUBLIC__/img/ui-sam.jpg" class="img-circle"
                                                            width="60"></a></p>
            <h5 class="centered">Shi Niang</h5>

            <li class="mt">
                <a class="active" href="../index.html">
                    <i class="fa fa-dashboard"></i>
                    <span>首页</span>
                </a>
            </li>

            <li class="sub-menu">
                <a href="javascript:;">
                    <i class="fa fa-desktop"></i>
                    <span>日报</span>
                </a>
                <ul class="sub">
                    <li><a>我的日报</a></li>
                    <li><a>他人日报</a></li>
                    <li><a>评论我的</a></li>
                    <li><a>回复我的</a></li>
                </ul>
            </li>

            <li class="sub-menu">
                <a href="javascript:;">
                    <i class="fa fa-cogs"></i>
                    <span>任务</span>
                </a>
                <ul class="sub">
                    <li><a href="../index.html">我的任务</a>
                        <ul class="sub">
                            <li><a href="../index.html">·负责的任务</a></li>
                            <li><a>·创建的任务</a></li>
                            <li><a>·参与的任务</a></li>
                        </ul>
                    </li>
                    <li><a>未读任务</a></li>
                    <li><a>新反馈任务</a></li>
                    <li><a>下属任务</a></li>
                    <li><a>已完成任务</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;">
                    <i class="fa fa-book"></i>
                    <span>目标</span>
                </a>
                <ul class="sub">
                    <li><a>我的目标</a>
                        <ul class="sub">
                            <li><a href="../index.html">·负责的目标</a></li>
                            <li><a>·创建的目标</a></li>
                            <li><a>·参与的目标</a></li>
                        </ul>
                    </li>
                    <li><a>未读的目标</a></li>
                    <li><a>新反馈的目标</a></li>
                    <li><a>下属目标</a></li>
                    <li><a>已完成目标</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;">
                    <i class="fa fa fa-envelope-o"></i>
                    <span>文档</span>
                </a>
                <ul class="sub">
                    <li><a>我负责的文档</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;">
                    <i class="fa fa-th"></i>
                    <span>客户管理</span>
                </a>
                <ul class="sub">
                    <li><a>我的客户</a></li>
                    <li><a>。。。。</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;">
                    <i class=" fa fa-tasks"></i>
                    <span>文档库</span>
                </a>
                <ul class="sub">
                    <li><a>我的文档</a></li>
                    <li><a>...</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;">
                    <i class=" fa fa-bar-chart-o"></i>
                    <span>考勤</span>
                </a>
            </li>

        </ul>
        <!-- sidebar menu end-->
    </div>
</aside>
<!--sidebar end-->

<!-- **********************************************************************************************************************************************************
MAIN CONTENT
*********************************************************************************************************************************************************** -->
<!--main content start-->
<section id="main-content">
    <section class="wrapper site-min-height">
        <!--<h3><i class="fa fa-angle-right"></i> Blank Page</h3>-->
        <div class="row mt">
            <div class="col-lg-12">
                <h3>
                    <a class="title" style="float: left">当日日报以及任务日志内容</a>
                </h3>

            </div>
        </div>
        <div class="project-header"></div>


        <div class="date_message">
            <h4 style="margin-bottom: 0"><a>标题：</a>{$item.title}</h4>
            <!--当天日报 主要在CLASS设置了today·-->
            <div class="message assignment" style="padding-top: 0em">
                <div class="message_left" style="margin-top: -2.1em">
                    <span class="calendar "><span class="day today">日报</span><span class="month"></span></span>
                </div>
                <div class="name">
                    <a>{$item.user_name}</a>
                    <span>2012-12-12</span>
                </div>

                <div class="operate">
                    <a href="{:U('Date/edit')}?id={$item.id}">编辑</a>
                    <a href="{:U('Date/del')}?id={$item.id}">删除</a>
                </div>

                <div class="content" style="margin-top: 3.5em">
                    <p>{$item.content}</p>
                </div>
            </div>
            <!--当天日报结束-->

            <div class="message" style="margin-top: 2em;">
                <i class="icon-event"></i>

                <div class="name" style="margin-left: 5em;margin-top: .2em">
                    <a style="font-weight: bold;font-size: 1.5em">评论内容</a>
                </div>

                <div class="mission">
                    <div style="width: 100%;height: 1px;background: #e6e6e6"></div>

                </div>
    
                <div id="comment_list">
                    <volist name="comments" id="vo">
                        <!--开始评论-->
                        <div class="comment">
                            <div class="head-photo"></div>
                            <div class="name">
                                <span class="comment-reserve"><a>{$vo.name}</a> 
                                <if condition="$vo.other_name neq NULL"> 
                                    回复 <a>{$vo.other_name}</a></span>
                                <else /> 
                                    </span>
                                </if>
                                <span>{$vo.comment_add}</span>
                            </div>
                            <div class="operate">
                                <a></a>
                            </div>
                            <div class="content">
                                <p>{$vo.comment}</p>
                            </div>
                        </div>
                    </volist>

                <div class="comment">
                    <div class="head-photo" style="background: url(../../img/date/head-photo-2.jpg);background-size: 3em"></div>
                    <div class="name">
                        <span class="comment-reserve"><a>师娘</a> 回复 <a>梓华</a></span>
                        <span>2012-12-12</span>
                    </div>
                    <div class="operate">
                        <a>回复</a>
                    </div>
                    <div class="content">
                        <p>this is content!</p>
                    </div>
                </div>
                </div>
               
                <div class="comment">
                    <div class="head-photo"></div>
                    <div class="name">
                        <input id="comment_content" class="form-control" placeholder="回复师娘：">

                        <a id="add_comment" class="btn btn-success btn-sm pull-left name-sm">提交评论</a>

                    </div>

                </div>
                <!--评论结束-->
            </div>


            <div class="message" style="margin-top: 2em;border: 0px">
                <i class="icon-event"></i>

                <div class="name" style="margin-left: 5em">
                    <a style="color: #999999;font-weight: bold">系统最新动态</a>
                    <!-- <span>标记完成(3)</span>
                    <span>新建任务(2)</span> -->
                </div>
                <div class="operate">
                    <span><i>来自系统任务日志</i></span>
                </div>

                <div class="mission">
                    <p>Edvard <a>创建了：</a> 5月1号前要完成日程模块
                        <i>(12:15:11)</i>
                    </p>

                    <p>Dasunsy <a>创建了：</a> 4月28日汇报总计的日报<i>(9:25:50)</i></p>

                    <p>振权 <a>完成了：</a>项目框架搭建的任务
                        <i>(18:11:11)</i></p>

                    <p>嘉树 <a>完成了：</a>入住商家合同签订
                        <i>(22:30:20)</i></p>

                </div>
            </div>

        </div>
    </section>
    <!-- --/wrapper ---->
</section>

<!--main content end-->
<!--footer start-->
<footer class="site-footer">
    <div class="text-center">
        2014 - Alvarez.is
        <a href="../index.html#" class="go-top">
            <i class="fa fa-angle-up"></i>
        </a>
    </div>
</footer>
<!--footer end-->
</section>
<!-- js placed at the end of the document so the pages load faster -->
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript" src="__PUBLIC__/js/jquery.dcjqaccordion.2.7.js"></script>
<script src="__PUBLIC__/js/jquery.scrollTo.min.js"></script>

<script src="__PUBLIC__/js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/jquery.sparkline.js"></script>

<!--common script for all pages-->
<script src="__PUBLIC__/js/common-scripts.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/gritter/js/jquery.gritter.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/gritter-conf.js"></script>
<script type="text/javascript">
    $(function(){

        $("#add_comment").click(function(){
            //添加评论事件
            var content = $("#comment_content").val();
            var otherName = 'NULL';
            var insertHtml = '';
            var myDate = new Date();
            var currentCalendar = myDate.getFullYear() + '-' + (myDate.getMonth()+1) + '-' + myDate.getDate();
            if(content.indexOf('@') != -1){
                content = content.split('@');
                var temp = content[1].split(' ')
                content = temp[1];
                otherName = temp[0];
                insertHtml = 
                    '<div class="comment">' + 
                    '<div class="head-photo"></div>' +
                    '<div class="name">'+
                        '<span class="comment-reserve"><a>林蕾</a> 回复 <a>' + otherName + '</a></span>'+
                        '<span>' + currentCalendar + '</span>'+
                    '</div>'+
                    '<div class="operate">'+
                        '<a>回复</a>' +
                    '</div>'+
                    '<div class="content">'+
                        '<p>'+content+'</p>'+
                    '</div>' + 
                    '</div>'
                    ;
            }else{
                insertHtml = 
                    '<div class="comment">' + 
                    '<div class="head-photo"></div>' +
                    '<div class="name">'+
                        '<span class="comment-reserve"><a>林蕾</a> 回复 </span>'+
                        '<span>' + currentCalendar + '</span>'+
                    '</div>'+
                    '<div class="operate">'+
                        '<a>回复</a>' +
                    '</div>'+
                    '<div class="content">'+
                        '<p>'+content+'</p>'+
                    '</div>' + 
                    '</div>'
                    ;
            }



            $('#comment_list').append(insertHtml);
            $("#comment_content").attr('value','');
            $.ajax({
                type: "POST",
                url: "{:U('Date/addComment')}",
                data: {
                    //目前这里为空，后期往服务器穿参数，就是要用到的
                    // username: $("#username").val(),
                    // content: $("#content").val()
                    report_id:'{$item.id}',
                    user_id:'1',
                    other_name:otherName,
                    comment:content,
                    comment_add:currentCalendar
                },
                dataType: "json",
                success: function(data) {
                    alert(data.result);
                },error:function(XMLHttpRequest, textStatus, errorThrown){
                        alert(XMLHttpRequest.status);
                        alert(XMLHttpRequest.readyState);
                        alert(textStatus);

                }
            });
        });
    });
</script>


</body>
</html>
